layui.use(['element', 'form', 'layedit','upload'], function () {
    var form = layui.form;
    var $ = layui.jquery,upload = layui.upload;

    //about banner1
    var uploadInst = upload.render({
        elem: '#LOGO_LOADING_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#LOGO_LOADING_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#LOGO_LOADING').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //about banner2
    var uploadInst = upload.render({
        elem: '#LOGO_PUBLIC_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#LOGO_PUBLIC_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#LOGO_PUBLIC').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //about 右侧
    var uploadInst = upload.render({
        elem: '#LOGO_TIPS_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#LOGO_TIPS_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#LOGO_TIPS').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //about title
    var uploadInst = upload.render({
        elem: '#ABOUT_T_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#ABOUT_T_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#ABOUT_T').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //magazine title
    var uploadInst = upload.render({
        elem: '#ABOUT_CON_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#ABOUT_CON_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#ABOUT_CON').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner title
    var uploadInst = upload.render({
        elem: '#MAGAZINE_T_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#MAGAZINE_T_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#MAGAZINE_T').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner person
    var uploadInst = upload.render({
        elem: '#PARTNER_H1_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#PARTNER_H1_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#PARTNER_H1').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner brand
    var uploadInst = upload.render({
        elem: '#PARTNER_H2_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#PARTNER_H2_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#PARTNER_H2').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item1
    var uploadInst = upload.render({
        elem: '#PARTNER_BAN_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#PARTNER_BAN_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#PARTNER_BAN').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item2
    var uploadInst = upload.render({
        elem: '#PARTNER_BOM_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#PARTNER_BOM_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#PARTNER_BOM').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item3
    var uploadInst = upload.render({
        elem: '#BENEFITS_T_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_T_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_T').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item4
    var uploadInst = upload.render({
        elem: '#BENEFITS_BAN_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_BAN_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_BAN').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item5
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS1_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS1_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS1').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item6
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS2_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS2_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS2').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item7
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS3_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS3_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS3').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner item8
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS4_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS4_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS4').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner title
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS5_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS5_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS5').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //partner right
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS6_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS6_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS6').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //news title
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS7_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS7_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS7').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //news rught1
    var uploadInst = upload.render({
        elem: '#BENEFITS_IS8_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IS8_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IS8').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //news rught2
    var uploadInst = upload.render({
        elem: '#NEWS_T_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#NEWS_T_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#NEWS_T').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //news rught3
    var uploadInst = upload.render({
        elem: '#USER_INFO_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#USER_INFO_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#USER_INFO').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    //user title
    var uploadInst = upload.render({
        elem: '#USER_BENEFITS_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#USER_BENEFITS_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#USER_BENEFITS').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

    var uploadInst = upload.render({
        elem: '#BENEFITS_IH2_bt'
        ,url: '/admin/index/uploadFile'
        ,before: function(obj){
            obj.preview(function(index, file, result){
                $('#BENEFITS_IH2_show').attr('src', result); 
            });
        }
        ,done: function(res){
            if(res.code > 0){
                return layer.msg('上传失败');
            }
            console.log(res.data.src)
            $('#BENEFITS_IH2').val(res.data.src);
        }
        ,error: function(){
            return layer.msg('上传失败');
        }
    });

})